package com.ss.android.common.ui.view;

import android.content.Context;
import android.util.AttributeSet;
import android.view.KeyEvent;
import android.widget.FrameLayout;

public class FullscreenVideoFrame extends FrameLayout {
    public interface OnHideFullscreenVideoFrameListener {
        void onHideFullscreenVideoFrame();
    }

    private OnHideFullscreenVideoFrameListener a;

    public FullscreenVideoFrame(Context arg1) {
        super(arg1);
        this.a();
    }

    public FullscreenVideoFrame(Context arg1, AttributeSet arg2) {
        super(arg1, arg2);
        this.a();
    }

    public FullscreenVideoFrame(Context arg1, AttributeSet arg2, int arg3) {
        super(arg1, arg2, arg3);
        this.a();
    }

    private void a() {
        this.setFocusable(true);
        this.setFocusableInTouchMode(true);
    }

    public boolean onKeyDown(int arg2, KeyEvent arg3) {
        boolean v0;
        if(arg2 == 4) {
            if(this.a != null) {
                this.a.onHideFullscreenVideoFrame();
            }

            v0 = true;
        }
        else {
            v0 = super.onKeyDown(arg2, arg3);
        }

        return v0;
    }

    public boolean onKeyUp(int arg2, KeyEvent arg3) {
        boolean v0 = arg2 == 4 ? true : super.onKeyUp(arg2, arg3);
        return v0;
    }

    public void setListener(OnHideFullscreenVideoFrameListener arg1) {
        this.a = arg1;
    }
}

